home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / kernel / method.d < prev    next >
Text File  |  1996-02-04  |  2KB  |  95 lines

  1. /*
  2.  *
  3.  *    Copyright (c) 1993-1996 Algorithms Corporation
  4.  *    3020 Liberty Hills Drive
  5.  *    Franklin, TN  37067
  6.  *
  7.  *    ALL RIGHTS RESERVED.
  8.  *
  9.  *
  10.  *
  11.  */
  12.  
  13. public    defclass Method  {
  14.     char    *name;
  15.     object    cls;
  16.     object    generic;
  17.     ofun    meth;
  18.     ofun    fmeth;        /*  fixed arg version of overloaded methods  */
  19.     int    trace;
  20.     object    next;
  21. };
  22.  
  23. imeth    char    *gName()
  24. {
  25.     return name;
  26. }    
  27.  
  28. imeth    int    gTrace(int mode)
  29. {
  30.     int    pmode = trace;
  31.     trace = mode;
  32.     return pmode;
  33. }
  34.  
  35. imeth    ofun    gFunction()
  36. {
  37.     return meth;
  38. }    
  39.  
  40. imeth    ofun    gChangeFunction(ofun fun)
  41. {
  42.     ofun    org;
  43.  
  44.     org = meth;
  45.     meth = fun;
  46.     return org;
  47. }    
  48.  
  49. imeth    gCopy()
  50. {
  51.     return gShouldNotImplement(self, "gCopy/gDeepCopy");
  52. }
  53.  
  54. objrtn    Method_initialize(void)
  55. {
  56.     static    int    done = 0;
  57.  
  58.     /*  Class creation and some of the methods are initialized by
  59.         the kernel  */
  60.  
  61.     if (done)
  62.         return Method_c;
  63.  
  64.     done = 1;
  65.  
  66. /*    Method_c = gNewClass(Class, "Method", sizeof(Method_iv_t), 0, END);    */
  67.  
  68.     iMethodFor(Method, gName, Method_im_gName);
  69.     iMethodFor(Method, gTrace, Method_im_gTrace);
  70.     iMethodFor(Method, gFunction, Method_im_gFunction);
  71.     iMethodFor(Method, gChangeFunction, Method_im_gChangeFunction);
  72.     iMethodFor(Method, gCopy, Method_im_gCopy);
  73.     iMethodFor(Method, gDeepCopy, Method_im_gCopy);
  74.     return Method_c;
  75. }
  76.  
  77. #if 0  /*  code for the benefit of dpp  */
  78.  
  79. cmeth gNewMethod(char *n, object c, object gen, ofun methf, ofun methf2){}
  80.  
  81. #endif
  82.  
  83.  
  84. /*
  85.  *
  86.  *    Copyright (c) 1993-1996 Algorithms Corporation
  87.  *    3020 Liberty Hills Drive
  88.  *    Franklin, TN  37067
  89.  *
  90.  *    ALL RIGHTS RESERVED.
  91.  *
  92.  *
  93.  *
  94.  */
  95.